package com.che.software.testato.domain.entity;

import java.io.Serializable;

/**
 * Class representing a versioned project (i.e. a project with the last related
 * version and the versions number).
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class VersionedProject implements Serializable {

	/**
	 * Constants
	 */
	private static final long serialVersionUID = 1189722597413843848L;

	/**
	 * Members.
	 */
	private long versionsNumber;
	private Project project;
	private Version lastVersion;

	/**
	 * Builder from fields.
	 * 
	 * @param versionsNumber the versions number for the given project.
	 * @param project the given project.
	 * @param lastVersion the last version for the given project.
	 */
	public VersionedProject(long versionsNumber, Project project, Version lastVersion) {
		super();
		this.versionsNumber = versionsNumber;
		this.project = project;
		this.lastVersion = lastVersion;
	}

	/**
	 * Getter for the private field value versionsNumber.
	 * 
	 * @return the versionsNumber field value.
	 */
	public long getVersionsNumber() {
		return versionsNumber;
	}

	/**
	 * Setting a value to the versionsNumber field.
	 * 
	 * @param versionsNumber the value to set.
	 */
	public void setVersionsNumber(long versionsNumber) {
		this.versionsNumber = versionsNumber;
	}

	/**
	 * Getter for the private field value project.
	 * 
	 * @return the project field value.
	 */
	public Project getProject() {
		return project;
	}

	/**
	 * Setting a value to the project field.
	 * 
	 * @param project the value to set.
	 */
	public void setProject(Project project) {
		this.project = project;
	}

	/**
	 * Getter for the private field value lastVersion.
	 * 
	 * @return the lastVersion field value.
	 */
	public Version getLastVersion() {
		return lastVersion;
	}

	/**
	 * Setting a value to the lastVersion field.
	 * 
	 * @param lastVersion the value to set.
	 */
	public void setLastVersion(Version lastVersion) {
		this.lastVersion = lastVersion;
	}
}